Produced by Araxis Merge on 2023-03-13 03:00:44 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Porto v4.0.4/Porto Theme/app/code/Smartwave/Megamenu/Plugin | RemoveBlock.php | 2020-06-10 07:58:06 +0000 |
| 2 | Porto v4.0.5/Porto Theme/app/code/Smartwave/Megamenu/Plugin | RemoveBlock.php | 2023-03-08 01:05:00 +0000 |
| Description | Between Files 1 and 2 | |
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 68 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 1 | 1 |
| Whitespace | Consecutive whitespace is treated as a single space |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
| Active line-pairing rules |
No regular expressions were active.
| 1 | <?php | 1 | <?php | |||
| 2 | 2 | |||||
| 3 | namespace Smartwave\Megamenu\Plugin; | 3 | namespace Smartwave\Megamenu\Plugin; | |||
| 4 | 4 | |||||
| 5 | use Magento\Framework\Event\Observer; | 5 | use Magento\Framework\Event\Observer; | |||
| 6 | use Magento\Framework\Event\ObserverInterface; | 6 | use Magento\Framework\Event\ObserverInterface; | |||
| 7 | use Magento\Framework\App\Config\ScopeConfigInterface; | 7 | use Magento\Framework\App\Config\ScopeConfigInterface; | |||
| 8 | use Magento\Store\Model\ScopeInterface; | 8 | use Magento\Store\Model\ScopeInterface; | |||
| 9 | 9 | |||||
| 10 | class RemoveBlock implements ObserverInterface | 10 | class RemoveBlock implements ObserverInterface | |||
| 11 | { | 11 | { | |||
| 12 | protected $_scopeConfig; | 12 | protected $_scopeConfig; | |||
| 13 | 13 | |||||
| 14 | public function __construct | 14 | public function __construct | |||
| 15 | ( | 15 | ( | |||
| 16 | ScopeConfigInterface $scopeConfig | 16 | ScopeConfigInterface $scopeConfig | |||
| 17 | ) | 17 | ) | |||
| 18 | { | 18 | { | |||
| 19 | $this->_scopeConfig = $scopeConfig; | 19 | $this->_scopeConfig = $scopeConfig; | |||
| 20 | } | 20 | } | |||
| 21 | 21 | |||||
| 22 | public function execute(Observer $observer) | 22 | public function execute(Observer $observer) | |||
| 23 | { | 23 | { | |||
| 24 | /** @var \Magento\Framework\View\Layout $layout */ | 24 | /** @var \Magento\Framework\View\Layout $layout */ | |||
| 25 | $layout = $observer->getLayout(); | 25 | $layout = $observer->getLayout(); | |||
| 26 | $block = $layout->getBlock('catalog.topnav'); // here block reference name to remove | 26 | $block = $layout->getBlock('catalog.topnav'); // here block reference name to remove | |||
| 27 | ||||||
| 28 | if ($block) { | 27 | if ($block) { | |||
| 29 | $remove = $this->_scopeConfig->getValue('sw_megamenu/general/enable', ScopeInterface::SCOPE_STORE); | 28 | $remove = $this->_scopeConfig->getValue('sw_megamenu/general/enable', ScopeInterface::SCOPE_STORE); | |||
| 30 | if ($remove) { | 29 | if ($remove) { | |||
| 31 | $layout->unsetElement('catalog.topnav'); | 30 | $layout->unsetElement('catalog.topnav'); | |||
| 32 | } | 31 | } | |||
| 33 | } | 32 | } | |||
| 34 | } | 33 | } | |||
| 35 | } | 34 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993–2019 Araxis Ltd (www.araxis.com). All rights reserved.